package self.example.explore.dao;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import self.example.explore.po.TbBrand;
import self.example.explore.po.TbBrandExample;

public interface TbBrandMapper {
    long countByExample(TbBrandExample example);

    int deleteByExample(TbBrandExample example);

    @Delete({
        "delete from tb_brand",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into tb_brand (id, brand_name, ",
        "company_name, ordered, ",
        "description, status)",
        "values (#{id,jdbcType=INTEGER}, #{brandName,jdbcType=VARCHAR}, ",
        "#{companyName,jdbcType=VARCHAR}, #{ordered,jdbcType=INTEGER}, ",
        "#{description,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER})"
    })
    int insert(TbBrand row);

    int insertSelective(TbBrand row);

    List<TbBrand> selectByExample(TbBrandExample example);

    @Select({
        "select",
        "id, brand_name, company_name, ordered, description, status",
        "from tb_brand",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("self.example.explore.dao.TbBrandMapper.BaseResultMap")
    TbBrand selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("row") TbBrand row, @Param("example") TbBrandExample example);

    int updateByExample(@Param("row") TbBrand row, @Param("example") TbBrandExample example);

    int updateByPrimaryKeySelective(TbBrand row);

    @Update({
        "update tb_brand",
        "set brand_name = #{brandName,jdbcType=VARCHAR},",
          "company_name = #{companyName,jdbcType=VARCHAR},",
          "ordered = #{ordered,jdbcType=INTEGER},",
          "description = #{description,jdbcType=VARCHAR},",
          "status = #{status,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(TbBrand row);
}